Subject: Re: MidStr
From: [email-masked]
To: [email-masked]
Cc: [email-masked], [email-masked]
Date: Thu, 29 Jul 93 11:22:41 BST

Check that you have got the parameters to InStr the right
way round - all languages order these things differently
and I can never remember which way round they go.

Next insert a WriteF('\d\n',endpos) after the endpos
assignment. If there is no \n in the buffer, endpos-pos
will be a negative number and could cause MidStr to return
all the characters it finds.

Also check that the parameters to MidStr are right. I once
got the parameters to StrCpy the wrong way round - I
thought it would be (source,dest) but it isn't. Took me
the best part of a day to figure that bug out.

Some E string functions require you to use E strings -
i.e. declare them as s[80]:STRING or something like that.
I would guess that this is the most likely problem.
Remember that if you do DEF a,b:STRING then a is a LONG
and b is a STRING. A similar statement in Pascal would
make both variables strings - that's a feature of E which
has caught me out many a time.

Hope this helps :-)

Dave.